package com.ctbri.manage.quality.original;
import org.apache.spark.sql.*;
import org.apache.spark.sql.types.*;

public interface BasicOp {
    public SparkSession envSet(final String appName, final String masterSet, final String logLevel);
    public SparkSession envSetHive(final String appName, final String masterSet, final String logLevel);
    public Dataset<Row> getDataFromExcel(final String path, SparkSession spark);
    public Dataset<Row> getDataFromExcel(final String path, SparkSession spark, StructType structType);
    public Dataset<Row> getDataFromJdbc(SparkSession spark, final String url, final String driver, final String user,
                                        final String password, final String dbtable);
    public Dataset<Row> getDataFromHive(SparkSession spark, final String databaseName, final String tableName);
    public long getDataTotalRowNum(Dataset<Row> data);
    public int getDataTotalColNum(Dataset<Row> data);

    public void resultSave(Dataset<Row> data, final String path, final String fileStyle);
}
